<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Bài toàn mới</title>
</head>
<body leftmargin="30" >

<?php 
require_once("../include/db_info.inc.php"); 
require_once("admin-header.php");
require_once("../fckeditor/fckeditor.php") ;
$myid=$_SESSION['user_id'];
?>
<center><h1>Thêm bài toán mới</h1></center>

<form method='POST' action='problem_add.php'>
<input type='hidden' name='problem_id' value="New Problem">
<p align=left>Tiêu đề: <input type='text' name='title' size='71'></p>
<p align=left>Giới hạn thời gian: <input type='text' name='time_limit' size='10' value='2'> giây</p>
<p align=left>Giới hạn bộ nhớ: <input type='text' name='memory_limit' size='10' value='1'> MB</p>
<h3>Mô tả:</h3>

<?php
$description = new FCKeditor('description') ;
$description->BasePath = '../fckeditor/' ;
$description->Height = 250 ;
$description->Width=800;

$description->Value = '<p></p>' ;
$description->Create() ;
?>
</p>

<h3>Input:</h3>

<?php
$input = new FCKeditor('input') ;
$input->BasePath = '../fckeditor/' ;
$input->Height = 150 ;
$input->Width=800;

$input->Value = '<p></p>' ;
$input->Create() ;
?>
</p>

</p>
<h3>Output:</h3>


<?php
$output = new FCKeditor('output') ;
$output->BasePath = '../fckeditor/' ;
$output->Height = 150 ;
$output->Width=800;

$output->Value = '<p></p>' ;
$output->Create() ;
?>

</p>
<h2>Ví dụ mẫu:</h2>
<h3>Input:</h3><textarea rows='5' name='sample_input' cols='80'></textarea></p>
<h3>Output:</h3><textarea rows='3' name='sample_output' cols='80'></textarea></p>
<h2>Bộ test 1:</h2>
<h3>Input:</h3><textarea rows='5' name='test_input' cols='80'></textarea></p>
<h3>Output:</h3><textarea rows='3' name='test_output' cols='80'></textarea></p>
<h2>Lưu ý:</h2>
<?php
$output = new FCKeditor('hint') ;
$output->BasePath = '../fckeditor/' ;
$output->Height = 150 ;
$output->Width=800;

$output->Value = '<p></p>' ;
$output->Create() ;
?>
</p>
<!--
<p>Chấm riêng: Không<input type=radio name=spj value='0' checked> Có<input type=radio name=spj value='1'></p>
-->
<input type='hidden' name='spj' value='0'>
<h3>Mã nguồn:</h3><textarea name='source' rows='3' cols='70'></textarea></p>
<p align=left>Kì thi:
	<select  name='contest_id'>
<?php 
$sql="SELECT `contest_id`,`title` FROM `contest` WHERE author_id='$myid' and `end_time`>NOW() order by `contest_id`";
$result=mysql_query($sql);
echo "<option value=''> </option>";
if (mysql_num_rows($result)==0){
}else{
	for (;$row=mysql_fetch_object($result);)
		echo "<option value='$row->contest_id'>$row->contest_id# $row->title</option>";
}

?>
	</select>
</p>
<div align=center>

<input type='submit' value='Thêm bài mới' name='submit'>
</div></form>
<p>
<?php 
//echo $sql;
require_once("../oj-footer.php");
?>
</body></html>

